package NG::Sys::Log;
use strict;
use warnings;
use utf8;


use Log::Syslog::Fast qw(:all);
use NG::Sys::App;

sub get_logger {
	my ($tag) = @_;
	my $script = app->script;
	my $logger = Log::Syslog::Fast->new(LOG_UNIX, "/dev/log", 0, LOG_LOCAL0, LOG_INFO, $tag, $script);
	return bless \$logger,__PACKAGE__;
}
sub send {
	my $self = shift;
	my $time = time();
	for my $msg (grep {$_} map {s/\s+/ /g;$_} map {split /\r?\n/} @_){
		$$self->send($msg,$time);
	}
}
1;
